import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home/Home.vue'
Vue.use(VueRouter)

const routes = [
  {
  
    //主页路由
    path: '/home',
    name: 'home',
    component: Home,
    //主页的子路由
    children:[
      //个性推荐路由
      {
        
        path:'recommend',
        meta:{activeIndex:1},
        component: function () {
               return import(/* webpackChunkName: "about" */ '../views/Home/Recommend.vue')
            }
      },
       //专属定制路由
      {
       
        path:'Exclusivecustom',
        component: function () {
               return import(/* webpackChunkName: "about" */ '../views/Home/Exclusivecustom.vue')
            }
      },
      //歌单路由
      {
        
        path:'Playlist',
        component: function () {
               return import(/* webpackChunkName: "about" */ '../views/Home/Playlist.vue')
            }
      },
      //排行榜路由
      {
        
        path:'RankingList',
        component: function () {
               return import(/* webpackChunkName: "about" */ '../views/Home/RankingList.vue')
            }
      },
      //歌手路由
      {
        
        path:'Singer',
        component: function () {
               return import(/* webpackChunkName: "about" */ '../views/Home/Singer.vue')
            },
            children:[
              {
                path:'specialalbum',
                component:function(){
                  return import(/* webpackChunkName: "about" */ '../components/Home/Singer/specialalbum.vue')
                }
              },
              {
                path:'MV',
                component:function(){
                  return import(/* webpackChunkName: "about" */ '../components/Home/Singer/MV.vue')
                }
              },
              {
                path:'Singerdetails1',
                component:function(){
                  return import(/* webpackChunkName: "about" */ '../components/Home/Singer/Singerdetails1.vue')
                }
              },
              {
                path:'Similarsinger',
                component:function(){
                  return import(/* webpackChunkName: "about" */ '../components/Home/Singer/Similarsinger.vue')
                }
              }
            ]
      },
      {
        path:'Singerdetails',
        component:function(){
          return import(/* webpackChunkName: "about" */ '../views/Home/Singerdetails.vue')
        }
      },
      //最新音乐路由
      {
        
        path:'Latestmusic',
        component: function () {
               return import(/* webpackChunkName: "about" */ '../views/Home/Latestmusic.vue')
            },
            children:[
              {
                //新歌速递
                path:'Songexpress',
                component:function(){
                  return import(/* webpackChunkName: "about" */ '../components/Home/Latestmusic/Songexpress.vue')
                }
              },
              {
                //新碟上架
                path:'Disconshelves',
                component:function(){
                  return import(/* webpackChunkName: "about" */ '../components/Home/Latestmusic/Disconshelves.vue')
                }
              }
            ]
      },
      //精品歌单   
      {
        path:'BoutiquesongList',
        component:function(){
          return import(/* webpackChunkName: "about" */ '../views/Home/BoutiquesongList.vue')
        }
      },
      //歌单详情
      {
        path:'Songlistdetails',
        name:'Songlistdetails',
        component:function(){
          return import(/* webpackChunkName: "about" */ '../views/Home/Songlistdetails.vue')
        }
      },
      //每日推荐歌曲
      {
        path:'Dailyrecommendation',
        component:function(){
          return import(/* webpackChunkName: "about" */ '../views/Home/Dailyrecommendation.vue')
        }
      },
      //搜索面板
      {
        path:'Searchpanel',
        component:function(){
          return import(/* webpackChunkName: "about" */ '../views/Home/Searchpanel/Searchpanel.vue')
        }
      },
      {
        path:'/Specialalbum',
        component:function () {
          return import(/* webpackChunkName: "about" */ '../views/Specialalbum/Specialalbum')
        },
      }
    ]
  },
  //重定向
  {
    path:'/',
    redirect:'/home/recommend'
  },
  //视频路由
  {
    path:'/videoclip',
    component:function () {
      return import(/* webpackChunkName: "about" */ '../views/videoclip/Videoclip.vue')
    },
    children:[
      {
        path:'Videolist',
        component:function () {
          return import(/* webpackChunkName: "about" */ '../views/videoclip/Videolist.vue')
        },
      },
      {
        path:'VideoMV',
        component:function () {
          return import(/* webpackChunkName: "about" */ '../views/videoclip/VideoMV.vue')
        },
      }
    ]
  },
  //朋友路由
  {
    path:'/friend',
    component:function () {
      return import(/* webpackChunkName: "about" */ '../views/friend/Friend.vue')
    },
  },
  //直播路由
  {
    path:'/streaming',
    component:function () {
      return import(/* webpackChunkName: "about" */ '../views/livestreaming/Livestreaming.vue')
    },
  },
    //视频路由
    {
      path:'/Privatefm',
      component:function () {
        return import(/* webpackChunkName: "about" */ '../views/Privatefm/Privatefm.vue')
      },
    },
    //专辑路由
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: function () {
  //     return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  //   }
  // }
]

const router = new VueRouter({
  routes,
  
})
router.beforeEach((to, from, next) => {
  document.body.scrollTop = 0
  // firefox
  document.documentElement.scrollTop = 0
  next()
})
export default router
